layui.use(['table', 'admin', 'form', 'ax'], function () {
    var $ = layui.$;
    var table = layui.table;
    var $ax = layui.ax;
    var admin = layui.admin;
    var form = layui.form;

    var queryData = {};
    queryData['btyZxMdzxId'] =  Feng.getUrlParam("btyZxMdzxId");

    table.render({
        elem: '#mdzxTable',
        url: Feng.ctxPath + '/dgdmdzx/investmentSituationInfo',
        where: queryData,
        cellMinWidth: 150,//全局定义常规单元格的最小宽度，layui 2.2.1 新增
        cols: [[
            {field: 'firstLevelName', width: 100, title: '一级科目',align:"center"}
            , {field: 'secondLevelName', width: 130, title: '二级科目',align:"center"}
            , {field: 'jine', title: '金额',width: 100,align:"center",templet : function(row) {if(row.jine==null||row.jine==''){return "0";}else {return row.jine;}}}
            , {field: 'content', title: '备注',align:"center"}
        ]],
        page: false
    });

    //返回按钮
    $("#backupPage").click(function () {
        window.location.href = Feng.ctxPath + '/mdzx'
    });

    // 导出excel
    $('#btnExp').click(function () {
        var btyZxMdzxId=Feng.getUrlParam("btyZxMdzxId");
        if(btyZxMdzxId==""||btyZxMdzxId==undefined||btyZxMdzxId==null){
            Feng.error("请先选择装修门店");
        }else {
            //获取导出Excel的数据
            var url=Feng.ctxPath + "/dgdmdzx/listExport?btyZxMdzxId="+btyZxMdzxId;
            location.href = url;
        }
    });


});
